package RemotePlay.Client;

import RemotePlay.Server.RemoteSubject;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.Remote;
import java.rmi.RemoteException;

public class ClientApplication {
    public static void main(String[] args) {
        Remote remoteObject = null;
        try {
            remoteObject = Naming.lookup("rmi://127.0.0.1");
            RemoteSubject remoteSubject = (RemoteSubject) remoteObject;
            remoteSubject.setHeight(323);
            remoteSubject.setWidth(34);
            double area = remoteSubject.getArea();
            System.out.println("area="+area);
        } catch (NotBoundException e) {
            e.printStackTrace();
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (RemoteException e) {
            e.printStackTrace();
        }

    }
}
